<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta content="IE=8" http-equiv="X-UA-Compatible" />
    <title>用户列表</title>
    {$QPath}
    <link rel="stylesheet" type="text/css" href="__TMPL__../Admin/Public/base.css" />
    <script type="text/javascript" src="__TMPL__../Admin/Public/mootools.js"></script>
    <script type="text/javascript" src="__TMPL__../Admin/Public/base.js"></script>
    <script type="text/javascript">
        var searchOpts={tag:'用户',action:'__URL__/index'};
    </script>
</head>
<body>
    <div id="container">
        <table class="tabmenu" cellspacing="0">
            <tbody>
                <tr>
                    <td class="wedge">&nbsp;</td>
                    <td class="wmenu here">用户列表</td>
                    <td class="wmenu"><a href="__URL__/add"><span>添加用户</span></a></td>
                    <td class="wmenu"><a href="__APP__/pRole/index"><span>角色列表</span></a></td>
                    <td class="wmenu"><a href="__APP__/pRole/add"><span>添加角色</span></a></td>
                    <td>&nbsp;</td>
                </tr>
            </tbody>
        </table>
        <div class="main">
            <?php
            if(array_key_exists('q',$_GET)){
            ?>
            <div class="findResult">
                <b>查找结果</b>(关键字:<b class="keyword">{.q}</b>)
            </div>
            <script type="text/javascript">
                highlight('{.q}',{selector:'#gridInst .grid'});
            </script>
            <?php
            }
            ?>
            <ul class="fnc">
                <li class="page">{$page}</li>
                <li><button type="button" class="btn" onclick="defEdit();">更改</button></li>
                <li><button type="button" class="btn" onclick="doRemoval();">删除</button></li>
            </ul>
            <form method="post" action="__URL__">
                <input type="hidden" name="a">
                <table class="data" id="gridInst">
                    <thead>
                        <tr>
                            <th class="cbCell"><input type="checkbox" id="effectAll" /></th>
                            <th>用户名</th>
                            <th>真实姓名</th>
                            <th>角色</th>
                            <th>邮箱</th>
                            <th>创建时间</th>
                        </tr>
                    </thead>
                    <tbody class="grid">
                        <present name="list">
                            <iterate name="list" id="vo">
                                <tr>
                                    <td><input type="checkbox" name="sid[]" value="{$vo['id']}"/></td>
                                    <td>{$vo['account']}</td>
                                    <td>{$vo['realname']}</td>
                                    <td>{$vo['rolename']}</td>
                                    <td>{$vo['email']}</td>
                                    <td>{$vo['created']}</td>
                                </tr>
                            </iterate>
                        <else/>
                            <tr class="notfound">
                                <td colspan="20">没有记录</td>
                            </tr>
                        </present>
                    </tbody>
                </table>
            </form>
            <ul class="fnc">
                <li class="page">{$page}</li>
                <li><button type="button" class="btn" onclick="defEdit();">更改</button></li>
                <li><button type="button" class="btn" onclick="doRemoval();">删除</button></li>
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        function doRemoval(){
            doAction('removal',{
                    submitType:'ajax',
                    ajaxOptions:{
                        runningMsg:'正在向服务器提交删除请求，请等候',
                        successMsg:'成功将选定的用户删除',
                        callback:function(result,json){
                            window.location.reload(true);
                        }
                    }
                });
        }
    </script>
</body>
</html>
